package Test;

import java.util.Arrays;
import java.util.Scanner;

public class change {
    public static void main(String[] args) {
        Scanner input= new Scanner(System.in);
        int[] socres = new int[7];
        socres[0] = 90;
        socres[1] = 60;
        socres[2] = 70;
        System.out.println("输入要更改的数字");
        int num=input.nextInt();
        int index=-1;
        for (int i=0;i<socres.length;i++){
            if (socres[i]==num){
                index=i;
                break;
            }
        }
        if(index==-1){
            System.out.println("false");
        }else {
            System.out.println("输入要改为哪个数字");
            num=input.nextInt();
            socres[index]=num;
            System.out.println("修改成功");
        }
        System.out.println(Arrays.toString(socres));
    }
}
